Learning Objectives

After completing this lesson, you'll be able to:

Instructions

In this lesson, you will:

Resources

Exercise

Jennifer

Jennifer's community map workspace now writes two tables, and the planning department has a third to add. Rather than editing the workspace every time a dataset appears, she wants the output schema defined in a spreadsheet the planning team can own themselves, without ever opening FME.

In this exercise, you will:

1) Open the Workspace and Inspect the Schema Spreadsheet

The spreadsheet is the whole point of this exercise, so it is worth reading before touching the workspace. Each row is one attribute, and the columns say which table it belongs to and what type it is.

Schema defined in an Excel table

Starting workspace

2) Replace the Resource Reader

The spreadsheet takes over the job the community map geodatabase was doing, so the old resource reader goes and a new one takes its place. The format to pick is the one that trips people up.

Removing the reader resource

Select Sheet1

Matching column names to their function

3) Set the Writer Schema Sources

The writer still points at the readers for its schema. Switching it to the spreadsheet is what puts the planning team in control of the output structure.

Setting Schema Source to Schema From Table

4) Add the Zones Reader

The spreadsheet already describes a Zones table, but nothing is reading that data yet. This time it is a real reader, not a resource.

Zoning reader feature type added

5) Run the Workspace

All three tables should now come out with the structure the spreadsheet describes. What they will not have is data in the new columns, and that gap is deliberate.

6) Read Data with a FeatureReader

A spreadsheet is one way to supply a schema. A FeatureReader is another, and it produces the schema and the data together, which is worth seeing side by side with what you just built.

FeatureReader

7) Add a Second Dynamic Writer

Those two ports are all a dynamic writer needs: one supplies the structure, the other the rows. Wiring both into one writer reproduces the source tables without a schema being defined anywhere in the workspace.

Writer added

Changing Schema Source

8) Re-Run the Entire Workspace

A partial run can let cached data reach the writer before the schema does, and the schema has to arrive first. Re-running everything is what guarantees the order.

You have defined an output schema two different ways: from a spreadsheet the planning team maintains, and from a schema feature a FeatureReader produces at run time. Neither approach requires the workspace to know the structure of the data in advance.

 

Tips